import './api/axios'
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from './api/axios'
import '../src/assets/iconfontal/iconfontal.css'
//在vue2.x中，我们想设置全局变量，可以在main文件中用prototype绑定vue实列，在vue3.0中，可以用app.config.globalProperties来代替prototype，具体用法如下
const app = createApp(App)

router.beforeEach((to, from, next) => {
    //储存路由title
    store.commit('saverouter',to)
    // console.log(store.state.routertitle)
    // console.log(to.path)
    next()
})
app.use(store)
app.use(router)
app.config.globalProperties.$api = axios // 自定义添加
app.mount('#app')

// createApp(App).use(store).use(router).mount('#app')
